package com.example.composestudy.part6

import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.tooling.preview.Preview

@Preview(showBackground = true)
@Composable
fun DrawOval() {
    PageItem(text = "DrawOval1") {
        Canvas(modifier = Modifier.fillMaxSize()) {
            drawRect(
                color = Color.Blue,
                size = Size(600f, 800f),
                topLeft = Offset(100f, 100f),
            )
            drawOval(
                color = Color.Red,
                size = Size(600f, 800f),
                topLeft = Offset(100f, 100f),
                style = Stroke(width = 5f)
            )
        }
    }
}